package lab03.Test08;

import java.io.*;

/**
 * Created by Aguest on 2017/12/8.
 */
public class Test {
    public static void main(String[] args) {

    }
        public static void SequenceTest1(String file1, String file2,String file3){
            try {
                FileInputStream iStream1 = new FileInputStream(new File(file1));
                FileInputStream iStream2 = new FileInputStream(new File(file2));
                FileOutputStream iStream3 = new FileOutputStream(new File(file3));
                InputStream si = new SequenceInputStream(iStream1, iStream2);
                byte[] arr = new byte[1024*20];
                int len = 0;
                while ((len = si.read(arr))!=-1) {
                    iStream3.write(arr,0,len);
                    iStream3.flush();//刷新此缓冲的输出流。
                }
                si.close();
                iStream3.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
